/*
 * Copyright (C) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifndef SMART_SRC_MAIN_CPP_SMARTREFRESHCONTROLCOMPONENTJSIBINDER_H
#define SMART_SRC_MAIN_CPP_SMARTREFRESHCONTROLCOMPONENTJSIBINDER_H
#include "RNOH/BaseComponentJSIBinder.h"
#include "RNOHCorePackage/ComponentBinders/ViewComponentJSIBinder.h"
namespace rnoh {
class NativeEngineViewJSIBinder : public ViewComponentJSIBinder {
protected:
    facebook::jsi::Object createNativeProps(facebook::jsi::Runtime &rt) override {
        auto object = ViewComponentJSIBinder::createNativeProps(rt);
        object.setProperty(rt, "isTransparent", "boolean");
        object.setProperty(rt, "antiAliasing", "number");
        object.setProperty(rt, "androidView", "string");
        return object;
    }

    facebook::jsi::Object createCommands(facebook::jsi::Runtime &rt) override {
        auto commands = ViewComponentJSIBinder::createCommands(rt);
        commands.setProperty(rt, "takeSnapshot", "takeSnapshot");
        return commands;
    }

    facebook::jsi::Object createBubblingEventTypes(facebook::jsi::Runtime &rt) override {
        facebook::jsi::Object events(rt);
        return events;
    }

    facebook::jsi::Object createDirectEventTypes(facebook::jsi::Runtime &rt) override {
        facebook::jsi::Object events(rt);
        events.setProperty(rt, "topSnapshotDataReturned", createDirectEvent(rt, "onSnapshotDataReturned"));
        return events;
    }
};
} // namespace rnoh

#endif